package com.lym.order;

import com.lym.order.feign.WeaterFeignClient;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

/**
 * 第三方API 天气服务 测试类
 */
@SpringBootTest
public class WeatherClient {

    @Autowired
    private WeaterFeignClient weaterFeignClient;

    @Test
    public void test() {
        String weather = weaterFeignClient.getWeather("APPCODE xxx", "xxx", "2182");
        System.out.println("weather = " + weather);
    }

    @Test
    public void test2() {
        String weather = weaterFeignClient.getWeather2("1", "安徽", "合肥");
        System.out.println("weather = " + weather);
        /**
         * ========== 打印结果 ==========
         * weather = {"result":{"weather":{"air":{"aqi":60,"aqi_level":2,"aqi_name":"良","co":"6","no2":"18","o3":"20","pm10":"60","pm2.5":"59","so2":"3","update_time":"202502242300"},"province":"安徽","city":"合肥","forecast_24h":{"0":{"day_weather":"晴","day_weather_code":"0","day_weather_short":"晴","day_wind_direction":"东南风","day_wind_direction_code":"","day_wind_power":"2","day_wind_power_code":"","max_degree":"8","min_degree":"2","night_weather":"阴","night_weather_code":"2","night_weather_short":"阴","night_wind_direction":"东南风","night_wind_direction_code":"","night_wind_power":"2","night_wind_power_code":"","time":"20250224"},"1":{"day_weather":"多云","day_weather_code":"1","day_weather_short":"多云","day_wind_direction":"西风","day_wind_direction_code":"","day_wind_power":"3","day_wind_power_code":"","max_degree":"13","min_degree":"1","night_weather":"晴","night_weather_code":"30","night_weather_short":"晴","night_wind_direction":"南风","night_wind_direction_code":"","night_wind_power":"2","night_wind_power_code":"","time":"20250225"},"10":{"day_weather":"阴","day_weather_code":"2","day_weather_short":"阴","day_wind_direction":"东北风","day_wind_direction_code":"","day_wind_power":"3","day_wind_power_code":"","max_degree":"8","min_degree":"0","night_weather":"阴","night_weather_code":"2","night_weather_short":"阴","night_wind_direction":"东北风","night_wind_direction_code":"","night_wind_power":"2","night_wind_power_code":"","time":"20250306"},"11":{"day_weather":"阴","day_weather_code":"2","day_weather_short":"阴","day_wind_direction":"西北风","day_wind_direction_code":"","day_wind_power":"3","day_wind_power_code":"","max_degree":"8","min_degree":"0","night_weather":"阴","night_weather_code":"2","night_weather_short":"阴","night_wind_direction":"东北风","night_wind_direction_code":"","night_wind_power":"2","night_wind_power_code":"","time":"20250307"},"12":{"day_weather":"阴","day_weather_code":"2","day_weather_short":"阴","day_wind_direction":"东北风","day_wind_direction_code":"","day_wind_power":"3","day_wind_power_code":"","max_degree":"9","min_degree":"0","night_weather":"阴","night_weather_code":"2","night_weather_short":"阴","night_wind_direction":"东北风","night_wind_direction_code":"","night_wind_power":"3","night_wind_power_code":"","time":"20250308"},"13":{"day_weather":"晴","day_weather_code":"0","day_weather_short":"晴","day_wind_direction":"东北风","day_wind_direction_code":"","day_wind_power":"3","day_wind_power_code":"","max_degree":"11","min_degree":"0","night_weather":"阴","night_weather_code":"2","night_weather_short":"阴","night_wind_direction":"东北风","night_wind_direction_code":"","night_wind_power":"2","night_wind_power_code":"","time":"20250309"},"14":{"day_weather":"阴","day_weather_code":"2","day_weather_short":"阴","day_wind_direction":"东北风","day_wind_direction_code":"","day_wind_power":"3","day_wind_power_code":"","max_degree":"12","min_degree":"0","night_weather":"阴","night_weather_code":"2","night_weather_short":"阴","night_wind_direction":"东风","night_wind_direction_code":"","night_wind_power":"2","night_wind_power_code":"","time":"20250310"},"15":{"day_weather":"阴","day_weather_code":"2","day_weather_short":"阴","day_wind_direction":"东北风","day_wind_direction_code":"","day_wind_power":"3","day_wind_power_code":"","max_degree":"12","min_degree":"0","night_weather":"阴","night_weather_code":"2","night_weather_short":"阴","night_wind_direction":"东风","night_wind_direction_code":"","night_wind_power":"2","night_wind_power_code":"","time":"20250311"},"2":{"day_weather":"多云","day_weather_code":"1","day_weather_short":"多云","day_wind_direction":"东南风","day_wind_direction_code":"","day_wind_power":"3","day_wind_power_code":"","max_degree":"16","min_degree":"3","night_weather":"多云","night_weather_code":"31","night_weather_short":"多云","night_wind_direction":"东南风","night_wind_direction_code":"","night_wind_power":"2","night_wind_power_code":"","time":"20250226"},"3":{"day_weather":"晴","day_weather_code":"0","day_weather_short":"晴","day_wind_direction":"东南风","day_wind_direction_code":"","day_wind_power":"2","day_wind_power_code":"","max_degree":"20","min_degree":"6","night_weather":"多云","night_weather_code":"31","night_weather_short":"多云","night_wind_direction":"东南风","night_wind_direction_code":"","night_wind_power":"2","night_wind_power_code":"","time":"20250227"},"4":{"day_weather":"多云","day_weather_code":"1","day_weather_short":"多云","day_wind_direction":"东南风","day_wind_direction_code":"","day_wind_power":"3","day_wind_power_code":"","max_degree":"23","min_degree":"10","night_weather":"小雨","night_weather_code":"7","night_weather_short":"小雨","night_wind_direction":"东南风","night_wind_direction_code":"","night_wind_power":"2","night_wind_power_code":"","time":"20250228"},"5":{"day_weather":"小雨","day_weather_code":"7","day_weather_short":"小雨","day_wind_direction":"南风","day_wind_direction_code":"","day_wind_power":"3","day_wind_power_code":"","max_degree":"26","min_degree":"13","night_weather":"大雨","night_weather_code":"9","night_weather_short":"大雨","night_wind_direction":"东北风","night_wind_direction_code":"","night_wind_power":"2","night_wind_power_code":"","time":"20250301"},"6":{"day_weather":"中雨","day_weather_code":"8","day_weather_short":"中雨","day_wind_direction":"东北风","day_wind_direction_code":"","day_wind_power":"4","day_wind_power_code":"","max_degree":"17","min_degree":"5","night_weather":"小雨","night_weather_code":"7","night_weather_short":"小雨","night_wind_direction":"东北风","night_wind_direction_code":"","night_wind_power":"3","night_wind_power_code":"","time":"20250302"},"7":{"day_weather":"阴","day_weather_code":"2","day_weather_short":"阴","day_wind_direction":"东北风","day_wind_direction_code":"","day_wind_power":"4","day_wind_power_code":"","max_degree":"7","min_degree":"-2","night_weather":"雪","night_weather_code":"15","night_weather_short":"雪","night_wind_direction":"西北风","night_wind_direction_code":"","night_wind_power":"3","night_wind_power_code":"","time":"20250303"},"8":{"day_weather":"晴","day_weather_code":"0","day_weather_short":"晴","day_wind_direction":"东北风","day_wind_direction_code":"","day_wind_power":"3","day_wind_power_code":"","max_degree":"6","min_degree":"-1","night_weather":"阴","night_weather_code":"2","night_weather_short":"阴","night_wind_direction":"东北风","night_wind_direction_code":"","night_wind_power":"2","night_wind_power_code":"","time":"20250304"},"9":{"day_weather":"阴","day_weather_code":"2","day_weather_short":"阴","day_wind_direction":"东北风","day_wind_direction_code":"","day_wind_power":"3","day_wind_power_code":"","max_degree":"12","min_degree":"3","night_weather":"小雨","night_weather_code":"7","night_weather_short":"小雨","night_wind_direction":"东北风","night_wind_direction_code":"","night_wind_power":"3","night_wind_power_code":"","time":"20250305"}},"hour":{"0":{"condition":"晴","date":"2025-02-26","hour":"0","humidity":"30","iconDay":"0","iconNight":"30","pressure":"1029","realFeel":"2","temp":"4","uvi":"1","windDir":"SSW","windSpeed":"5.04"},"1":{"condition":"阴","date":"2025-02-25","hour":"1","humidity":"52","iconDay":"2","iconNight":"2","pressure":"1031","realFeel":"3","temp":"5","uvi":"1","windDir":"ESE","windSpeed":"3.96"},"10":{"condition":"阴","date":"2025-02-25","hour":"10","humidity":"58","iconDay":"2","iconNight":"2","pressure":"1031","realFeel":"4","temp":"7","uvi":"2","windDir":"SW","windSpeed":"7.56"},"11":{"condition":"阴","date":"2025-02-25","hour":"11","humidity":"58","iconDay":"2","iconNight":"2","pressure":"1030","realFeel":"5","temp":"8","uvi":"2","windDir":"WSW","windSpeed":"10.80"},"12":{"condition":"阴","date":"2025-02-25","hour":"12","humidity":"56","iconDay":"2","iconNight":"2","pressure":"1030","realFeel":"6","temp":"9","uvi":"3","windDir":"WSW","windSpeed":"12.24"},"13":{"condition":"阴","date":"2025-02-25","hour":"13","humidity":"54","iconDay":"2","iconNight":"2","pressure":"1029","realFeel":"7","temp":"11","uvi":"3","windDir":"W","windSpeed":"13.32"},"14":{"condition":"阴","date":"2025-02-25","hour":"14","humidity":"51","iconDay":"2","iconNight":"2","pressure":"1028","realFeel":"8","temp":"12","uvi":"3","windDir":"W","windSpeed":"13.32"},"15":{"condition":"晴","date":"2025-02-25","hour":"15","humidity":"48","iconDay":"0","iconNight":"30","pressure":"1028","realFeel":"9","temp":"12","uvi":"4","windDir":"W","windSpeed":"11.88"},"16":{"condition":"晴","date":"2025-02-25","hour":"16","humidity":"44","iconDay":"0","iconNight":"30","pressure":"1027","realFeel":"10","temp":"12","uvi":"4","windDir":"WNW","windSpeed":"11.16"},"17":{"condition":"晴","date":"2025-02-25","hour":"17","humidity":"46","iconDay":"0","iconNight":"30","pressure":"1027","realFeel":"10","temp":"13","uvi":"4","windDir":"W","windSpeed":"9.72"},"18":{"condition":"晴","date":"2025-02-25","hour":"18","humidity":"52","iconDay":"0","iconNight":"30","pressure":"1028","realFeel":"9","temp":"11","uvi":"4","windDir":"SSW","windSpeed":"6.84"},"19":{"condition":"晴","date":"2025-02-25","hour":"19","humidity":"59","iconDay":"0","iconNight":"30","pressure":"1028","realFeel":"8","temp":"9","uvi":"1","windDir":"SW","windSpeed":"5.04"},"2":{"condition":"阴","date":"2025-02-25","hour":"2","humidity":"56","iconDay":"2","iconNight":"2","pressure":"1031","realFeel":"3","temp":"5","uvi":"1","windDir":"ESE","windSpeed":"2.52"},"20":{"condition":"晴","date":"2025-02-25","hour":"20","humidity":"67","iconDay":"0","iconNight":"30","pressure":"1029","realFeel":"6","temp":"7","uvi":"1","windDir":"SSE","windSpeed":"4.68"},"21":{"condition":"晴","date":"2025-02-25","hour":"21","humidity":"71","iconDay":"0","iconNight":"30","pressure":"1029","realFeel":"4","temp":"7","uvi":"1","windDir":"S","windSpeed":"5.04"},"22":{"condition":"晴","date":"2025-02-25","hour":"22","humidity":"76","iconDay":"0","iconNight":"30","pressure":"1029","realFeel":"3","temp":"6","uvi":"1","windDir":"S","windSpeed":"5.76"},"23":{"condition":"晴","date":"2025-02-25","hour":"23","humidity":"79","iconDay":"0","iconNight":"30","pressure":"1029","realFeel":"3","temp":"5","uvi":"1","windDir":"S","windSpeed":"5.76"},"3":{"condition":"阴","date":"2025-02-25","hour":"3","humidity":"60","iconDay":"2","iconNight":"2","pressure":"1030","realFeel":"3","temp":"5","uvi":"1","windDir":"SE","windSpeed":"1.80"},"4":{"condition":"阴","date":"2025-02-25","hour":"4","humidity":"63","iconDay":"2","iconNight":"2","pressure":"1030","realFeel":"3","temp":"5","uvi":"1","windDir":"ESE","windSpeed":"1.80"},"5":{"condition":"阴","date":"2025-02-25","hour":"5","humidity":"68","iconDay":"2","iconNight":"2","pressure":"1030","realFeel":"2","temp":"5","uvi":"1","windDir":"E","windSpeed":"2.52"},"6":{"condition":"阴","date":"2025-02-25","hour":"6","humidity":"71","iconDay":"2","iconNight":"2","pressure":"1030","realFeel":"2","temp":"5","uvi":"1","windDir":"ESE","windSpeed":"2.52"},"7":{"condition":"阴","date":"2025-02-25","hour":"7","humidity":"63","iconDay":"2","iconNight":"2","pressure":"1030","realFeel":"2","temp":"5","uvi":"1","windDir":"ESE","windSpeed":"2.88"},"8":{"condition":"阴","date":"2025-02-25","hour":"8","humidity":"58","iconDay":"2","iconNight":"2","pressure":"1031","realFeel":"2","temp":"5","uvi":"1","windDir":"SE","windSpeed":"3.24"},"9":{"condition":"阴","date":"2025-02-25","hour":"9","humidity":"56","iconDay":"2","iconNight":"2","pressure":"1031","realFeel":"3","temp":"6","uvi":"1","windDir":"WSW","windSpeed":"5.40"}},"observe":{"degree":"7","humidity":"","precipitation":"","pressure":"","update_time":"000101010000","weather":"","weather_code":"","weather_short":"晴","wind_direction":"","wind_power":""}}},"success":true}
         */
    }

}
